import jdk.swing.interop.SwingInterOpUtils;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: wwy
 * Date: 2024-05-01
 * Time: 20:03
 */
//汉诺塔
public class HanNuoTa {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入汉诺塔的层数");
        int n= sc.nextInt();
        hanNuoTa(n,'a','b','c');
        System.out.println(-1<<1);
    }
    public static void hanNuoTa(int n,char x,char y,char z){
        if(n==1){
            move(x,z);
        }
        else{
            hanNuoTa(n-1,x,z,y);
            move(x,z);
            hanNuoTa(n-1,y,x,z);
        }
    }
    public static void move(char x,char y){
        System.out.println(x+"->"+y);
    }
}
